int receive,i=0,j=0;
char txt;

//void usart_str(char *s){while(*s){usart_write(*s++);}}

void main()
{
    TRISB=0b00000011;TRISD=0;
    portb=0;portd=0;

    Lcd_Custom_Config(&PORTD,7,6,5,4,&PORTB,5,4,3);
    Lcd_Custom_Cmd(Lcd_Cursor_Off);
    Lcd_Custom_Cmd(Lcd_Clear);
    Lcd_Custom_Out(1,1,"Test Program");
    
    Usart_Init(9600);
    
    while(1)
    {
        //if(!portb.f0)
//        {
//            Usart_str("stop");
//        }

        if (Usart_Data_Ready())
        {
                txt=Usart_Read();
        }

        while(txt)
        {
                usart_write(txt);
                //IntToStr(receive,txt);
                Lcd_Custom_chr(2,1,txt);
                txt=0;
        }
    }
}